package com.zkj.nacos.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName: DemoController
 * @Description: TODO
 * @Author: 朱开军
 * @Date: 2021-9-26 18:06
 */
@RefreshScope
@RestController
public class DemoController {

    @Value("${zkj.name}")
    private String zkjName="ss";
    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/nacos")
    public String readConfig(HttpServletRequest request){
        System.out.println("test");
        System.out.println("sss");
        System.out.println("zkjName:"+request.getParameter("zkjName"));
        return "当前的端口配置是：" + serverPort +"名字："+ zkjName;
    }


}
